; *** Solitaire, Star
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com

(version "2.0")
(translate
 ("Star A" "星形 1") ("Star B" "星形 2") ("Points" "六角星形")
 ("Small Triangle" "4行三角")
 ("Triangle A" "5行三角 1") ("Triangle B" "5行三角 2")
 ("Triangle C" "5行三角 3") ("Triangle D" "5行三角 4")
 ("Big Triangle" "6行三角") ("Super Triangle" "7行三角")
 ("Triangle 4 Plus" "4行多三角") ("Triangle 5 Plus" "5行多三角")
)
(define jump ($1 (verify not-empty?) capture $1 (verify empty?) add))

(define board-defs
	(positions (h1   61  11  83  31)

		         (h2   14  38  36  58)
			   (h3   44  38  70  58)
			   (h4   78  38 100  58)
			   (h5  110  38 132  58)

			   (h6   29  66  51  88)
			   (h7   61  66  83  88)
		       (h8   93  66 115  88)

		       (h9   12  95  34  117)
			   (h10  44  95  66  117)
			   (h11  76  95  98  117)
			   (h12 108  95 130  117)

               (h13  61 122  83 144)
	)
	(links e (h2 h3) (h3 h4) (h4 h5) (h6 h7) (h7 h8)
             (h9 h10) (h10 h11) (h11 h12)
	)
	(links w (h12 h11) (h11 h10) (h10 h9)
             (h8 h7) (h7 h6) (h5 h4) (h4 h3) (h3 h2)
	)
    (links sw (h1 h3) (h3 h6) (h6 h9) (h4 h7) (h7 h10)
             (h5 h8) (h8 h11) (h11 h13)
    )
    (links ne (h13 h11) (h11 h8) (h8 h5)
             (h10 h7) (h7 h4) (h9 h6) (h6 h3) (h3 h1)
    )
    (links se (h2 h6) (h6 h10) (h10 h13) (h3 h7) (h7 h11)
             (h1 h4) (h4 h8) (h8 h12)
    )
    (links nw (h12 h8) (h8 h4) (h4 h1)
             (h11 h7) (h7 h3) (h13 h10) (h10 h6) (h6 h2)
    )
)

(define board-defs-triangle
	(positions (e1   72  12  94  34)

		       (d2   57  38  79  60)
			   (e2   87  38 109  60)

			   (c3   42  64  64  86)
			   (d3   72  64  94  86)
			   (e3  102  64 124  86)

               (b4   27  90  49 112)
			   (c4   57  90  79 112)
		       (d4   87  90 109 112)
		       (e4  117  90 139 112)
			   
			   (a5   12 116  34 138)
			   (b5   42 116  64 138)
               (c5   72 116  94 138)
			   (d5  102 116 124 138)
			   (e5  132 116 154 138)
	)
	(links e                         (d2 e2)
	                         (c3 d3) (d3 e3)
			         (b4 c4) (c4 d4) (d4 e4)
	         (a5 b5) (b5 c5) (c5 d5) (d5 e5)           
	)
	(links w (e2 d2) 
	         (e3 d3) (d3 c3) 
			 (e4 d4) (d4 c4) (c4 b4)
	         (e5 d5) (d5 c5) (c5 b5) (b5 a5)
	)
    (links se (e1 e2) (e2 e3) (e3 e4) (e4 e5)
	          (d2 d3) (d3 d4) (d4 d5)
			  (c3 c4) (c4 c5) (b4 b5)
    )
    (links nw (e5 e4) (e4 e3) (e3 e2) (e2 e1)
	          (d5 d4) (d4 d3) (d3 d2) 
			  (c5 c4) (c4 c3)
			  (b5 b4)
    )
    (links sw (e1 d2) (d2 c3) (c3 b4) (b4 a5)
	          (e2 d3) (d3 c4) (c4 b5) 
			  (e3 d4) (d4 c5)
			  (e4 d5)
    )
    (links ne (a5 b4) (b4 c3) (c3 d2) (d2 e1)
	          (b5 c4) (c4 d3) (d3 e2)
			  (c5 d4) (d4 e3)
			  (d5 e4)
    )
)

(game
    (title "Star A")
	(solution "Solutions\Solitaire,_Star\Star_A.zsg")
    (description "沿直线跳过相邻棋子吃掉它。\\
本关目标：剩下一个棋子")
    (history "Stellar (Star) Solitaire is described by John D. Beasley in his book
       `The Ins and Outs of Peg Solitaire.`  Larger star boards are possible.  To
       have a star solveable with any single marble missing requires a board with
       at least 121 holes.")
    (strategy "It's impossible for the center marble to jump anywhere, so the only way
       the center can be vacated is if it is jumped.\\
       To see the solution, select `Show Solution` under the Help menu.")
    (option "prevent flipping" 2)
    (music "Audio\\Twinkle.mid")
	(opening-sound "Audio\\Clinking.wav")
    (move-sound "")
	(capture-sound "Audio\\Ding.wav")
    (win-sound "Audio\\Twink.wav")
    (loss-sound "Audio\\Twink.wav")
    (players Player)
    (turn-order Player)
    (board
        (image "images\Solitaire\Star.bmp")
		(board-defs)
	)

    (piece
        (name Marble)
		(help "跳过相邻棋子吃掉它。")
        (description "Marble\Marbles jump over each other in a straight line
		   as in Checkers.  Marbles that are jumped over are taken off the board.")
        (image Player "images\Solitaire\YellowMarble2.bmp" "images\Solitaire\YellowMarble.bmp")
		(moves
			(jump e)
            (jump w)
            (jump ne)
			(jump se)
			(jump nw)
			(jump sw)
		)			
	)
            
    (board-setup
        (Player (Marble h2 h3 h4 h5 h6 h7 h8 h9 h10 h11 h12 h13))
	)

    (win-condition (Player)
        (pieces-remaining 1 Marble)
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Star B")
	(solution "Solutions\Solitaire,_Star\Star_B.zsg")
    (board-setup (Player (Marble h1 h2 h4 h5 h6 h7 h8 h9 h10 h11 h12 h13)))
)

(variant
    (title "Points")
    (solution "Solutions\Solitaire,_Star\Points.zsg")
    (description "沿直线跳过相邻棋子吃掉它。\\
本关目标：剩下6个棋子，且位于棋盘六个顶点");
    (board
        (image "images\Solitaire\StarPoints.bmp")
		(board-defs)
	)
    (board-setup (Player (Marble h1 h2 h3 h4 h6 h7 h8 h10 h11 h12 h13)))
    (win-condition (Player)
        (and (pieces-remaining 6 Marble) (absolute-config Marble (h1 h2 h5 h9 h12 h13)) )
    )
    (loss-condition (Player)
        (pieces-remaining 5 Marble)
    )
)


(variant (title "-")) ;------------------------------------------------------

(define TriangleCommon
    (history "Triangular Solitaire dates back to at least the 19th century;
         there is an American patent dated 1891.  It does not appear to have
         attracted much attention from puzzlers until about 1966, when Irvin R.
         Hentzel and Harry O. Davis independently investigated it.")
	(strategy "Try not to let a marble become stranded all by itself.  If you
       already have a stranded marble.  Try to plot its rescue!\\
       To see the solution, select `Show Solution` under the Help menu.")
    (option "prevent flipping" true)
    (music "Audio\\Twinkle2.mid")
    (move-sound "Audio\\Ding.wav")
)

(variant
    (title "Small Triangle")
    (solution "Solutions\Solitaire,_Star\Triangle4.zsg")
	(description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子")
    (TriangleCommon)
    (board
        (image "images\Solitaire\Triangle4.bmp")
		(positions (d1   72  12  94  34)

				   (c2   57  38  79  60)
				   (d2   87  38 109  60)

				   (b3   42  64  64  86)
				   (c3   72  64  94  86)
				   (d3  102  64 124  86)

				   (a4   27  90  49 112)
				   (b4   57  90  79 112)
				   (c4   87  90 109 112)
				   (d4  117  90 139 112)
		)
		(links e                         (c2 d2)
								 (b3 c3) (c3 d3)
						 (a4 b4) (b4 c4) (c4 d4)
		)
		(links w (d2 c2) 
				 (d3 c3) (c3 b3) 
				 (d4 c4) (c4 b4) (b4 a4)
		)
		(links se (d1 d2) (d2 d3) (d3 d4)
				  (c2 c3) (c3 c4)
				  (b3 b4)
		)
		(links nw (d4 d3) (d3 d2) (d2 d1)
				  (c4 c3) (c3 c2) 
				  (b4 b3)
		)
		(links sw (d1 c2) (c2 b3) (b3 a4)
				  (d2 c3) (c3 b4)
				  (d3 c4)
		)
		(links ne (a4 b3) (b3 c2) (c2 d1)
				  (b4 c3) (c3 d2)
				  (c4 d3)
		)
	)
    (board-setup
        (Player (Marble d1 d2 b3 c3 d3 a4 b4 c4 d4))
	)
)

(variant
    (title "Triangle A")
    (solution "Solutions\Solitaire,_Star\TriangleA.zsg")
	(description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子")
    (TriangleCommon)
    (board
        (image "images\Solitaire\Triangle.bmp")
        (board-defs-triangle)
	)
    (board-setup
        (Player (Marble e1 d2 e2 c3    e3 b4 c4 d4 e4 a5 b5 c5 d5 e5))
	)
)

(variant
  (title "Triangle B")
  (solution "Solutions\Solitaire,_Star\TriangleB.zsg")
  (description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子。\\进阶挑战：剩下一个棋子，且位于棋盘顶端")
  (TriangleCommon)
  (board
        (image "images\Solitaire\TriangleB.bmp")
        (board-defs-triangle)
  )
  (board-setup
        (Player (Marble d2 e2 c3 d3 e3 b4 c4 d4 e4 a5 b5 c5 d5 e5))
  )
)

(variant
  (title "Triangle C")
  (solution "Solutions\Solitaire,_Star\TriangleC.zsg")
  (description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子\\进阶挑战：剩下一个棋子，且位于棋盘顶端")
  (TriangleCommon)
  (board-setup
        (Player (Marble e1 e2 c3 d3 e3 b4 c4 d4 e4 a5 b5 c5 d5 e5))
  )
  (board
        (image "images\Solitaire\TriangleC.bmp")
        (board-defs-triangle)
  )
)

(variant
  (title "Triangle D")
  (solution "Solutions\Solitaire,_Star\TriangleD.zsg")
  (description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子。\\进阶挑战：剩下一个棋子，且位于棋盘顶端")
  (TriangleCommon)
  (board
        (image "images\Solitaire\TriangleD.bmp")
        (board-defs-triangle)
  )
  (board-setup
        (Player (Marble e1 d2 e2 d3 e3 b4 c4 d4 e4 a5 b5 c5 d5 e5))
  )
)


(variant
  (title "Big Triangle")
  (solution "Solutions\Solitaire,_Star\Triangle6.zsg")
  (description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子。\\进阶挑战：剩下一个棋子，且位于棋盘顶端")
  (TriangleCommon)
  (board
    (image "images\Solitaire\Triangle6.bmp")
	(positions (f1   87  12 109  34)

		       (e2   72  38  94  60)
			   (f2  102  38 124  60)

			   (d3   57  64  79  86)
			   (e3   87  64 109  86)
			   (f3  117  64 139  86)

               (c4   42  90  64 112)
			   (d4   72  90  94 112)
		       (e4  102  90 124 112)
		       (f4  132  90 154 112)
			   
			   (b5   27 116  49 138)
			   (c5   57 116  79 138)
               (d5   87 116 109 138)
			   (e5  117 116 139 138)
			   (f5  147 116 169 138)

			   (a6   12 142  34 164)
			   (b6   42 142  64 164)
               (c6   72 142  94 164)
			   (d6  102 142 124 164)
			   (e6  132 142 154 164)
			   (f6  162 142 184 164)
	)
	(links e                                 (e2 f2)
	                                 (d3 e3) (e3 f3)
			                 (c4 d4) (d4 e4) (e4 f4)
	                 (b5 c5) (c5 d5) (d5 e5) (e5 f5)
			 (a6 b6) (b6 c6) (c6 d6) (d6 e6) (e6 f6)       
	)
	(links w (f2 e2)
	         (f3 e3) (e3 d3)
			 (f4 e4) (e4 d4) (d4 c4)
			 (f5 e5) (e5 d5) (d5 c5) (c5 b5)
	         (f6 e6) (e6 d6) (d6 c6) (c6 b6) (b6 a6)
	)
    (links se (f1 f2) (f2 f3) (f3 f4) (f4 f5) (f5 f6)
	                  (e2 e3) (e3 e4) (e4 e5) (e5 e6)
	                          (d3 d4) (d4 d5) (d5 d6)
			                          (c4 c5) (c5 c6)
									          (b5 b6)
    )
    (links nw (f6 f5) (f5 f4) (f4 f3) (f3 f2) (f2 f1)
	          (e6 e5) (e5 e4) (e4 e3) (e3 e2)
	          (d6 d5) (d5 d4) (d4 d3)
			  (c6 c5) (c5 c4)
			  (b6 b5)
    )
    (links sw (f1 e2) (e2 d3) (d3 c4) (c4 b5) (b5 a6)
	          (f2 e3) (e3 d4) (d4 c5) (c5 b6)
	          (f3 e4) (e4 d5) (d5 c6)
			  (f4 e5) (e5 d6)
			  (f5 e6)
    )
    (links ne (a6 b5) (b5 c4) (c4 d3) (d3 e2) (e2 f1)
	                  (b6 c5) (c5 d4) (d4 e3) (e3 f2)
					          (c6 d5) (d5 e4) (e4 f3)
							          (d6 e5) (e5 f4)
									          (e6 f5)
    )
  )
  (board-setup
        (Player (Marble e2 f2 d3 e3 f3 c4 d4 e4 f4 b5 c5 d5 e5 f5 a6 b6 c6 d6 e6 f6))
  )
)

(variant
  (title "Super Triangle")
  (solution "Solutions\Solitaire,_Star\Triangle7.zsg")
  (description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子。")
  (TriangleCommon)
  (board
    (image "images\Solitaire\Triangle7.bmp")
	(positions (g1  102  12 124  34)

		       (f2   87  38 109  60)
			   (g2  117  38 139  60)

			   (e3   72  64  94  86)
			   (f3  102  64 124  86)
			   (g3  132  64 154  86)

               (d4   57  90  79 112)
			   (e4   87  90 109 112)
		       (f4  117  90 139 112)
		       (g4  147  90 169 112)
			   
			   (c5   42 116  64 138)
			   (d5   72 116  94 138)
               (e5  102 116 124 138)
			   (f5  132 116 154 138)
			   (g5  162 116 184 138)

			   (b6   27 142  49 164)
			   (c6   57 142  79 164)
               (d6   87 142 109 164)
			   (e6  117 142 139 164)
			   (f6  147 142 169 164)
			   (g6  177 142 199 164)

			   (a7   12 168  34 190)
			   (b7   42 168  64 190)
               (c7   72 168  94 190)
			   (d7  102 168 124 190)
			   (e7  132 168 154 190)
			   (f7  162 168 184 190)
			   (g7  192 168 214 190)
	)
	(links e                                         (f2 g2)
	                                         (e3 f3) (f3 g3)
			                         (d4 e4) (e4 f4) (f4 g4)
	                         (c5 d5) (d5 e5) (e5 f5) (f5 g5)
			         (b6 c6) (c6 d6) (d6 e6) (e6 f6) (f6 g6) 
             (a7 b7) (b7 c7) (c7 d7) (d7 e7) (e7 f7) (f7 g7)   
	)
	(links w (g2 f2)
	         (g3 f3) (f3 e3)
			 (g4 f4) (f4 e4) (e4 d4)
			 (g5 f5) (f5 e5) (e5 d5) (d5 c5)
	         (g6 f6) (f6 e6) (e6 d6) (d6 c6) (c6 b6)
			 (g7 f7) (f7 e7) (e7 d7) (d7 c7) (c7 b7) (b7 a7)
	)
    (links se (g1 g2) (g2 g3) (g3 g4) (g4 g5) (g5 g6) (g6 g7)
	                  (f2 f3) (f3 f4) (f4 f5) (f5 f6) (f6 f7)
	                          (e3 e4) (e4 e5) (e5 e6) (e6 e7)
	                                  (d4 d5) (d5 d6) (d6 d7)
			                                  (c5 c6) (c6 c7)
									                  (b6 b7)
    )
    (links nw (g7 g6) (g6 g5) (g5 g4) (g4 g3) (g3 g2) (g2 g1)
	          (f7 f6) (f6 f5) (f5 f4) (f4 f3) (f3 f2)
	          (e7 e6) (e6 e5) (e5 e4) (e4 e3)
	          (d7 d6) (d6 d5) (d5 d4)
			  (c7 c6) (c6 c5)
			  (b7 b6)
    )
    (links sw (g1 f2) (f2 e3) (e3 d4) (d4 c5) (c5 b6) (b6 a7)
              (g2 f3) (f3 e4) (e4 d5) (d5 c6) (c6 b7)
	          (g3 f4) (f4 e5) (e5 d6) (d6 c7)
	          (g4 f5) (f5 e6) (e6 d7)
			  (g5 f6) (f6 e7)
			  (g6 f7) 
    )
    (links ne (a7 b6) (b6 c5) (c5 d4) (d4 e3) (e3 f2) (f2 g1)
                      (b7 c6) (c6 d5) (d5 e4) (e4 f3) (f3 g2)
                              (c7 d6) (d6 e5) (e5 f4) (f4 g3)
                                      (d7 e6) (e6 f5) (f5 g4)
                                              (e7 f6) (f6 g5)
                                                      (f7 g6)
							          
    )
  )
  (board-setup
        (Player (Marble g1 g2 e3 f3 g3 d4 e4 f4 g4 c5 d5 e5 f5 g5 b6 c6 d6 e6 f6 g6 a7 b7 c7 d7 e7 f7 g7))
  )
)


(variant (title "-")) ;------------------------------------------------------

(variant
  (title "Triangle 4 Plus")
  (solution "Solutions\Solitaire,_Star\Triangle4Plus.zsg")
  (description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子。")
  (TriangleCommon)
  (board
    (image "images\Solitaire\Triangle4Plus.bmp")
	(positions (f2   87  38 109  60)
			   (g2  117  38 139  60)

			   (f3  102  64 124  86)

			   (e4   87  90 109 112)
		       (f4  117  90 139 112)
			   
			   (d5   72 116  94 138)
               (e5  102 116 124 138)
			   (f5  132 116 154 138)

			   (b6   27 142  49 164)
			   (c6   57 142  79 164)
               (d6   87 142 109 164)
			   (e6  117 142 139 164)
			   (f6  147 142 169 164)
			   (g6  177 142 199 164)

			   (b7   42 168  64 190)
			   (f7  162 168 184 190)
	)
	(links e                                 (e4 f4)
	                                 (d5 e5) (e5 f5)
			         (b6 c6) (c6 d6) (d6 e6) (e6 f6) (f6 g6) 
	)
	(links w         (f4 e4)
			         (f5 e5) (e5 d5)
	         (g6 f6) (f6 e6) (e6 d6) (d6 c6) (c6 b6)
	)
    (links se         (f2 f3) (f3 f4) (f4 f5) (f5 f6) (f6 f7)
	                                  (e4 e5) (e5 e6)
	                                          (d5 d6)
    )
    (links nw (f7 f6) (f6 f5) (f5 f4) (f4 f3) (f3 f2)
	                  (e6 e5) (e5 e4)
	                  (d6 d5)
    )
    (links sw (g2 f3) (f3 e4) (e4 d5) (d5 c6) (c6 b7)
	                  (f4 e5) (e5 d6)
	                  (f5 e6)
    )
    (links ne         (b7 c6) (c6 d5) (d5 e4) (e4 f3) (f3 g2)
                                      (d6 e5) (e5 f4)
                                              (e6 f5)
							          
    )
  )
  (board-setup
        (Player (Marble f2 g2 f3 f4 d5 e5 f5 b6 c6 d6 e6 f6 g6 b7 f7))
  )
)


(variant
  (title "Triangle 5 Plus")
  (solution "Solutions\Solitaire,_Star\Triangle5Plus.zsg")
  (description "沿直线跳过相邻棋子吃掉它。\\
           本关目标：剩下一个棋子。.")
  (TriangleCommon)
  (board
    (image "images\Solitaire\Triangle5Plus.bmp")
	(positions (g1  102  12 124  34)
	           (h1  132  12 154  34)

			   (g2  117  38 139  60)

			   (f3  102  64 124  86)
			   (g3  132  64 154  86)

			   (e4   87  90 109 112)
		       (f4  117  90 139 112)
		       (g4  147  90 169 112)
			   
			   (d5   72 116  94 138)
               (e5  102 116 124 138)
			   (f5  132 116 154 138)
			   (g5  162 116 184 138)

			   (b6   27 142  49 164)
			   (c6   57 142  79 164)
               (d6   87 142 109 164)
			   (e6  117 142 139 164)
			   (f6  147 142 169 164)
			   (g6  177 142 199 164)
			   (h6  207 142 229 164)

			   (b7   42 168  64 190)
			   (g7  192 168 214 190)
	)
	(links e                                         (f3 g3)
			                                 (e4 f4) (f4 g4)
	                                 (d5 e5) (e5 f5) (f5 g5)
			         (b6 c6) (c6 d6) (d6 e6) (e6 f6) (f6 g6) (g6 h6)
	)
	(links w         (g3 f3)
			         (g4 f4) (f4 e4)
			         (g5 f5) (f5 e5) (e5 d5)
	         (h6 g6) (g6 f6) (f6 e6) (e6 d6) (d6 c6) (c6 b6)
	)
    (links se (g1 g2) (g2 g3) (g3 g4) (g4 g5) (g5 g6) (g6 g7)
	                          (f3 f4) (f4 f5) (f5 f6)
	                                  (e4 e5) (e5 e6)
	                                          (d5 d6)
    )
    (links nw (g7 g6) (g6 g5) (g5 g4) (g4 g3) (g3 g2) (g2 g1)
	                  (f6 f5) (f5 f4) (f4 f3)
	                  (e6 e5) (e5 e4)
	                  (d6 d5)
    )
    (links sw (h1 g2) (g2 f3) (f3 e4) (e4 d5) (d5 c6) (c6 b7)
	                  (g3 f4) (f4 e5) (e5 d6)
	                  (g4 f5) (f5 e6) 
			          (g5 f6)
    )
    (links ne         (b7 c6) (c6 d5) (d5 e4) (e4 f3) (f3 g2) (g2 h1)
                                      (d6 e5) (e5 f4) (f4 g3)
                                              (e6 f5) (f5 g4)
                                                      (f6 g5)
							          
    )
  )
  (board-setup
        (Player (Marble g1 h1 g2 f3 g3 e4 g4 d5 e5 f5 g5 b6 c6 d6 e6 f6 g6 h6 b7 g7))
  )
)
